#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    getline(cin,s);
    int n;
    cin >> n;
    for (int i = 0; s[i] != '\0'; i++)
    {
        if (s[i] <= 'z'&&s[i]>='a')
        {
            s[i] = (s[i] + n +26- 'a') % 26 + 'a';
        }
        if (s[i] <= 'Z' && s[i] >= 'A')
        {
            s[i] = (s[i] + n +26- 'A') % 26 + 'A';
        }
    }
    cout << "Encrypted message:" << s << endl;




    return 0;
}